#include <catch2/catch.hpp>

#include <array>

#include "solution.hpp"

using namespace solution_429;

TEST_CASE("429_n-ary_tree_level_order_traversal", "[429]")
{
    auto nodes = std::array { Node(0), Node(1), Node(2), Node(3), Node(4), Node(5), Node(6) };
    nodes[1].children = { &nodes[3], &nodes[2], &nodes[4] };
    nodes[3].children = { &nodes[5], &nodes[6] };
    CHECK(Solution().levelOrder(&nodes[1]) == std::vector< std::vector<int> >{{1},{3,2,4},{5,6}});
}
